<template>
  <view style="padding-top: 100rpx;">
    <view class="text-area">
      <text>输入值：</text><input type="text" v-model="title" style="color: red;background-color: antiquewhite;"/>
    </view>
    <view class="text-area">
      <text>回传值：</text><input type="text" :value="callBackValue" style="color: blue;background-color: antiquewhite;"/>
    </view>
    <comA :intent="title" class="box-a"></comA>
    <comB @callBackFun="callBack"></comB>
  </view>
</template>

<script>
  import comA from '../../../components/comA.vue';
  import comB from '../../../components/comB.vue';
  export default {
    components: {
      comA,
      comB
    },
    data() {
      return {
        title: '', // 关键：初始化输入值变量
        callBackValue: '' // 关键：初始化回传值变量
      }
    },
    methods: {
      callBack(msg){
        console.warn("---index---callBack-->"+msg);
        this.callBackValue = msg;
      }
    }
  }
</script>

<style>
.text-area{
  display: flex;
  padding-bottom: 55rpx;
}
</style>